package main

import "fmt"

func main() {
	var arr1 [5]int
	arr2 := [3]int{1, 2, 9}
	arr3 := [...]int{1, 2, 3, 7, 9}
	var grid [4][3]int
	var cube [4][3][2]bool
	fmt.Println(arr1)
	fmt.Println(arr2)
	fmt.Println(arr3)
	fmt.Println(grid)
	fmt.Println(cube)
	//数组的读取,range只有一个接收值时是下标
	for i, v := range arr3 {
		fmt.Printf("arr3[%d] = %d \n", i, v)
	}
	//数组的传递，值传递
	printArray(arr1)
	printArray(arr3)
	fmt.Println(arr1, arr3)
}

func printArray(arr [5]int) {
	arr[0] = 999
	for i, v := range arr {
		fmt.Println(i, " ===> ", v)
	}
}
